home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Q-R / RTFcard1.0.cpt / RTFcard1.0 / RTF Import 1.0 / cards.xml < prev    next >
Text File  |  1992-09-24  |  35KB  |  301 lines

  1. card_3026.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3026</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_4493.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2719</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3212.css" />
  13.     <part>
  14.         <id>1</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>13</left>
  25.             <top>8</top>
  26.             <right>245</right>
  27.             <bottom>67</bottom>
  28.         </rect>
  29.         <style>roundrect</style>
  30.         <showName> <true /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <true /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>24</textSize>
  40.         <textStyle>outline</textStyle>
  41.         <name>RTF Import</name>
  42.         <script>on mouseUpglobal Dest,HeadTblput empty into Destput empty into HeadTbl--put the name of the destination field of the RTF text--into the variable Destput "Import" into Dest-- This code runs ONLY on HC 2.0 and up.-- To be cautious, we check the version of HyperCard running.if the version < 2.0 thenanswer "Sorry, you need HyperCard 2.0 or better." with "OK"exit mouseUpend ifanswer file "Pick an RTF file." of type "TEXT"if it is empty then exit mouseupset the cursor to watchlock Screenput it into MyFileopen file MyFileread from file MyFile until NumToChar(3) --EOFput it into FilteredText--First, we separate the different bodies of the RTF file--and we generate some reference tables from them--The first body is the definition with the font tableput char 1 to offset("}}",FilteredText) of FilteredText after Header--We find the metaCharactersrepeat with MyChar = 1 to (the length of Header)set cursor to busyif (char MyChar of Header) = "{" or (char MyChar of Header) = "}"then put RETURN after HeadTblelseif (char MyChar of FilteredText) = "\"then put RETURN after HeadTblelse put char MyChar of FilteredText after HeadTblend ifend repeat--This gives us a table with items separated by returnsif (word 1 of HeadTbl) ‚â†"rtf1" or (word 3 of HeadTbl) ‚â†"deff2"thenanswer "This is not a supported version of RTF file." with "OK"close file MyFileexit mouseupend if--We checked for the right type of RTF file--We can now eliminate the header and keep the font table onlydelete line 1 to 8 of HeadTblrepeat (the number of lines of HeadTbl)set cursor to busyput offset(RETURN&RETURN,HeadTbl) into DblRetif DblRet ‚↠0 thendelete char DblRet to (DblRet + 1) of HeadTblput RETURN before char DblRet of HeadTblelseexit repeatend ifend repeatrepeat with LineNo = 1 to (the number of lines of HeadTbl div 2)set cursor to busydelete word 1 of line (LineNo * 2) of HeadTbldelete last char of line (LineNo * 2) of HeadTblend repeat--We eliminate the Header from the FilteredTextdelete char 1 to (offset("}}",FilteredText) + 1) of FilteredText--The second body is the colour table--Since HC doesn't support colour yet, we simply eliminate--it from the FilteredText and ignore this bodydelete char 1 to offset("}",FilteredText) of FilteredText--The third and fourth body are the stylesheet table--and the info sheet table.--Since supporting this feature would demand very complex--programming structures for text rarely bigger than--16 384 caracters, we decided to ignore it too although--we must set the standard style to the font of the--style "Normal" with size 12, no style.--The info doesn't serve any purpose in HC, we drop it too.put empty into NormalFontput empty into fontIDrepeat with thischar = (offset("\f",FilteredText) + 1) to ¬¨(offset("\f",FilteredText) + 8) -- an ID bigger than that is impossibleset cursor to busyif char thischar of FilteredText = "\" ¬¨or char thischar of FilteredText = " " thenexit repeatelseput char thisChar of FilteredText after fontIDend ifend repeatset the textFont of cd fld Dest to HandleFont(fontID)set the textSize of cd fld Dest to 12set the textStyle of cd fld Dest to plaindelete char 1 to (offset("}}",FilteredText) + 1) of FilteredTextdelete char 1 to (offset("}}",FilteredText) + 1) of FilteredText--The fifth body is the general page reference table--Since HC fields do not support layouts, we drop it toodelete char 1 to (offset("{",FilteredText)-1) of FilteredText--Finally, the last part is the encoded text--We decode it to express all the special characters of--the Macintosh character set while giving it the right--set of Font, style and size--Note: It is imperative to remove any carriage returns--in the encoded text since it is hardcoded as "\par" anyway.repeat (length(FilteredText))set cursor to busyput offset(RETURN, FilteredText) into Spotif Spot ‚↠0 thendelete char Spot of FilteredTextelseexit repeatend ifend repeatdelete last char of FilteredText--INTERPRETING CHARACTERSput HandleChars(FilteredText) into cd fld Dest-- if it's a header or footer, we eliminate it.repeat (length(cd fld Dest) div 2)set cursor to busyput offset("\header",cd fld Dest) into headlocput offset("\footer",cd fld Dest) into footlocif (footloc ‚↠0) or (headloc ‚↠0) thenif (headloc ‚↠0) thendelete char headloc to (headloc + 8) of cd fld Destend ifput offset("\footer",cd fld Dest) into footlocif (footloc ‚↠0) thendelete char footloc to (footloc + 8) of cd fld Destend ifelseexit repeatend ifend repeatrepeat ((the length of cd fld Dest) div 2) -- maximum encodingset cursor to busyif (offset("{",cd fld Dest) ‚↠0) and (offset("{",cd fld Dest) ‚↠0) then--INTERPRETING FONT, SIZE AND STYLES--interpreting sizeput offset("{",cd fld Dest) into lAccolput offset("}",cd fld Dest) into rAccolput empty into MySizeif lAccol ‚↠0 thenput char lAccol to rAccol of cd fld Dest into tempStringput offset("\fs",tempString) into MetaCharLocif MetaCharLoc ‚↠0 thenif (char (MetaCharLoc + 7) of tempString) = " " thenput char (MetaCharLoc + 3) to (MetaCharLoc + 6) of tempString ¬¨into tempSizeend ifif (char (MetaCharLoc + 6) of tempString) = " " thenput char (MetaCharLoc + 3) to (MetaCharLoc + 5) of tempString ¬¨into tempSizeend ifif (char (MetaCharLoc + 5) of tempString) = " " thenput char (MetaCharLoc + 3) to (MetaCharLoc + 4) of tempString ¬¨into tempSizeend ifif (char (MetaCharLoc + 4) of tempString) = " " thenput (char (MetaCharLoc + 3) of tempString) into tempSizeend ifput tempSize div 2 into MySizeset the textsize of char lAccol to rAccol of cd fld Dest to MySizedelete char (MetaCharLoc + lAccol - 1) to ¬¨(MetaCharLoc + lAccol + length(TempSize) + 1) of cd fld Destend ifend if--interpreting fontput empty into MyFontIDput offset("{",cd fld Dest) into lAccolput offset("}",cd fld Dest) into rAccolput char lAccol to rAccol of cd fld Dest into tempStringput offset("\f",tempString) into MetaCharLocif (MetaCharLoc ‚↠0) and ¬¨(char (MetaCharLoc + 2) of tempString is in "1234567890") then-- We have to check the extent of the ID code (1,2,3,4 or 5 digits)if char (MetaCharLoc + 7) of tempString = " "¬¨or char (MetaCharLoc + 7) of tempString = "\"thenput char (MetaCharLoc + 1) to (MetaCharLoc + 6)¬¨of tempString into MyFontIDend ifif char (MetaCharLoc + 6) of tempString = " "¬¨or char (MetaCharLoc + 6) of tempString = "\"thenput char (MetaCharLoc + 1) to (MetaCharLoc + 5)¬¨of tempString into MyFontIDend ifif char (MetaCharLoc + 5) of tempString = " "¬¨or char (MetaCharLoc + 5) of tempString = "\"thenput char (MetaCharLoc + 1) to (MetaCharLoc + 4)¬¨of tempString into MyFontIDend ifif char (MetaCharLoc + 4) of tempString = " "¬¨or char (MetaCharLoc + 4) of tempString = "\"thenput char (MetaCharLoc + 1) to (MetaCharLoc + 3)¬¨of tempString into MyFontIDend ifif char (MetaCharLoc + 3) of tempString = " "¬¨or char (MetaCharLoc + 3) of tempString = "\"thenput char (MetaCharLoc + 1) to (MetaCharLoc + 2)¬¨of tempString into MyFontIDend ifset the textFont of char lAccol to rAccol of cd fld Dest ¬¨to HandleFont(MyFontID)delete char (lAccol + MetaCharLoc - 1) to ¬¨(lAccol + MetaCharLoc + length(MyFontID) - 1) of cd fld Destend if-- interpreting stylesput offset("{",cd fld Dest) into lAccolput offset("}",cd fld Dest) into rAccolput char lAccol to rAccol of cd fld Dest into tempstringput HandleStyles(tempstring) into theStyleset the textstyle of char lAccol to rAccol of cd fld Dest to theStyle--delete char 1 of tempStringput offset("\b",tempstring) into BoldLocif BoldLoc ‚↠0 thenif char (BoldLoc + 2) of tempstring = " "thendelete char (BoldLoc + lAccol) to ((BoldLoc + lAccol) + 2) of cd fld Destdelete char BoldLoc to (BoldLoc + 2) of tempStringelsedelete char (BoldLoc + lAccol) to (BoldLoc + lAccol + 1) of cd fld Destdelete char BoldLoc to (BoldLoc + 1) of tempStringend ifend ifput offset("\i",tempstring) into ItalicLocif ItalicLoc ‚↠0 thenif char (ItalicLoc + 2) of tempstring = " "thendelete char (ItalicLoc + lAccol) to ((ItalicLoc + lAccol) + 2) of cd fld Destdelete char ItalicLoc to (ItalicLoc + 2) of tempStringelsedelete char (ItalicLoc + lAccol) to (ItalicLoc + lAccol + 1) of cd fld Destdelete char ItalicLoc to (ItalicLoc + 1) of tempStringend ifend ifput offset("\ul",tempstring) into ULineLocif ULineLoc ‚↠0 thenif char (ULineLoc + 3) of tempstring = " "thendelete char (ULineLoc + lAccol) to ((ULineLoc + lAccol) + 3) of cd fld Destdelete char ULineLoc to (ULineLoc + 3) of tempStringelsedelete char (ULineLoc + lAccol) to (ULineLoc + lAccol + 2) of cd fld Destdelete char ULineLoc to (ULineLoc + 2) of tempStringend ifend ifput offset("\outl",tempstring) into OutLineLocif OutLineLoc ‚↠0 thenif char (OutLineLoc + 5) of tempstring = " "thendelete char (OutLineLoc + lAccol) to ((OutLineLoc + lAccol) + 5) of cd fld Destdelete char OutLineLoc to (OutLineLoc + 5) of tempStringelsedelete char (OutLineLoc + lAccol) to (OutLineLoc + lAccol + 4) of cd fld Destdelete char OutLineLoc to (OutLineLoc + 4) of tempStringend ifend ifput offset("\shad",tempstring) into ShadowLocif ShadowLoc ‚↠0 thenif char (ShadowLoc + 5) of tempstring = " "thendelete char (ShadowLoc + lAccol) to ((ShadowLoc + lAccol) + 5) of cd fld Destdelete char ShadowLoc to (ShadowLoc + 5) of tempStringelsedelete char (ShadowLoc + lAccol) to (ShadowLoc + lAccol + 4) of cd fld Destdelete char ShadowLoc to (ShadowLoc + 4) of tempStringend ifend ifput offset("{",cd fld Dest) into lAccolput offset("}",cd fld Dest) into rAccolif (lAccol ‚↠0) or (rAccol ‚↠0)thenif (lAccol ‚↠0) and (rAccol ‚↠0) thendelete char lAccol of cd fld Destdelete char (rAccol - 1) of cd fld Destend ifif (lAccol = 0) and (rAccol ‚↠0) thendelete char rAccol of cd fld Destend ifif (lAccol ‚↠0) and (rAccol = 0) thendelete char lAccol of cd fld Destend ifelseexit repeatend ifelseexit repeatend ifend repeatrepeat (length(cd fld Dest) div 2)set cursor to busyput offset("\bslash",cd fld Dest) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetacharLoc + 6) of cd fld Destput "\" before char MetaCharLoc of cd fld Destelseexit repeatend ifend repeatrepeat (length(cd fld Dest) div 2)set cursor to busyput offset("\lacc",cd fld Dest) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetacharLoc + 4) of cd fld Destput "{" before char MetaCharLoc of cd fld Destelseexit repeatend ifend repeatrepeat (length(cd fld Dest) div 2)set cursor to busyput offset("\racc",cd fld Dest) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetacharLoc + 4) of cd fld Destput "}" before char MetaCharLoc of cd fld Destelseexit repeatend ifend repeat-- ELIMINATING NON-SUPPORTED ENCODINGunlock screenrepeat (length(cd fld Dest) div 2)set cursor to busyput empty into tempStringput offset("\",cd fld Dest) into MetaCharLocif MetaCharLoc ‚↠0 thenrepeat with theChar = (MetaCharLoc + 1) to length(cd fld Dest)set cursor to busyif (char TheChar of cd fld Dest = " ") or ¬¨(char TheChar of cd fld Dest = "\") thenexit repeatelseput char TheChar of cd fld Dest after tempStringend ifend repeatdelete char MetaCharLoc to (MetaCharLoc + length(tempString)) of ¬¨cd fld Destif char MetaCharLoc of cd fld Dest = " " thendelete char MetaCharLoc of cd fld Destend ifelseexit repeatend ifend repeat--The Filtered Text remainsclose file MyFileunlock Screenend mouseUpfunction HandleCharacters TheString--interpreting special charactersput 1 into theStrCharif (char (theStrChar +2) of TheString)="8" thenif (char (theStrChar +3) of TheString)="1" then return "√Ö"if (char (theStrChar +3) of TheString)="2" then return "√á"if (char (theStrChar +3) of TheString)="3" then return "√â"if (char (theStrChar +3) of TheString)="7" then return "√°"if (char (theStrChar +3) of TheString)="8" then return "√†"if (char (theStrChar +3) of TheString)="9" then return "√¢"if (char (theStrChar +3) of TheString)="a" then return "√§"if (char (theStrChar +3) of TheString)="b" then return "√£"if (char (theStrChar +3) of TheString)="c" then return "√•"if (char (theStrChar +3) of TheString)="d" then return "√ß"if (char (theStrChar +3) of TheString)="e" then return "√©"if (char (theStrChar +3) of TheString)="f" then return "√®"end ifif (char (theStrChar +2) of TheString)="9" thenif (char (theStrChar +3) of TheString)="0" then return "√™"if (char (theStrChar +3) of TheString)="1" then return "√´"if (char (theStrChar +3) of TheString)="2" then return "√≠"if (char (theStrChar +3) of TheString)="3" then return "√¨"if (char (theStrChar +3) of TheString)="4" then return "√Æ"if (char (theStrChar +3) of TheString)="5" then return "√Ø"if (char (theStrChar +3) of TheString)="6" then return "√±"if (char (theStrChar +3) of TheString)="7" then return "√≥"if (char (theStrChar +3) of TheString)="8" then return "√≤"if (char (theStrChar +3) of TheString)="9" then return "√¥"if (char (theStrChar +3) of TheString)="a" then return "√§"if (char (theStrChar +3) of TheString)="b" then return "√µ"if (char (theStrChar +3) of TheString)="c" then return "√∫"if (char (theStrChar +3) of TheString)="d" then return "√π"if (char (theStrChar +3) of TheString)="e" then return "√ª"if (char (theStrChar +3) of TheString)="f" then return "√º"end ifif (char (theStrChar +2) of TheString)="a" thenif (char (theStrChar +3) of TheString)="0" then return "‚Ć"if (char (theStrChar +3) of TheString)="1" then return "¬∞"if (char (theStrChar +3) of TheString)="2" then return "¬¢"if (char (theStrChar +3) of TheString)="3" then return "¬£"if (char (theStrChar +3) of TheString)="4" then return "¬ß"if (char (theStrChar +3) of TheString)="6" then return "¬∂"if (char (theStrChar +3) of TheString)="7" then return "√ü"if (char (theStrChar +3) of TheString)="8" then return "¬Æ"if (char (theStrChar +3) of TheString)="9" then return "¬©"if (char (theStrChar +3) of TheString)="a" then return "‚Ñ¢"if (char (theStrChar +3) of TheString)="b" then return "¬¥"if (char (theStrChar +3) of TheString)="c" then return "¬®"if (char (theStrChar +3) of TheString)="d" then return "‚â†"if (char (theStrChar +3) of TheString)="e" then return "√Ü"if (char (theStrChar +3) of TheString)="f" then return "√ò"end ifif (char (theStrChar +2) of TheString)="b" thenif (char (theStrChar +3) of TheString)="0" then return "‚àû"if (char (theStrChar +3) of TheString)="1" then return "¬±"if (char (theStrChar +3) of TheString)="2" then return "‚â§"if (char (theStrChar +3) of TheString)="3" then return "‚â•"if (char (theStrChar +3) of TheString)="4" then return "¬•"if (char (theStrChar +3) of TheString)="5" then return "¬µ"if (char (theStrChar +3) of TheString)="6" then return "‚àÇ"if (char (theStrChar +3) of TheString)="7" then return "‚àë"if (char (theStrChar +3) of TheString)="8" then return "‚àè"if (char (theStrChar +3) of TheString)="9" then return "œÄ"if (char (theStrChar +3) of TheString)="a" then return "‚à´"if (char (theStrChar +3) of TheString)="b" then return "¬™"if (char (theStrChar +3) of TheString)="c" then return "¬∫"if (char (theStrChar +3) of TheString)="d" then return "Œ©"if (char (theStrChar +3) of TheString)="e" then return "√¶"if (char (theStrChar +3) of TheString)="f" then return "√∏"end ifif (char (theStrChar +2) of TheString)="c" thenif (char (theStrChar +3) of TheString)="0" then return "¬ø"if (char (theStrChar +3) of TheString)="1" then return "¬°"if (char (theStrChar +3) of TheString)="2" then return "¬¨"if (char (theStrChar +3) of TheString)="3" then return "‚àö"if (char (theStrChar +3) of TheString)="4" then return "Δí"if (char (theStrChar +3) of TheString)="5" then return "‚âà"if (char (theStrChar +3) of TheString)="6" then return "‚àÜ"if (char (theStrChar +3) of TheString)="7" then return "¬´"if (char (theStrChar +3) of TheString)="8" then return "¬ª"if (char (theStrChar +3) of TheString)="9" then return "‚Ķ"if (char (theStrChar +3) of TheString)="e" then return "≈í"if (char (theStrChar +3) of TheString)="f" then return "≈ì"end ifif (char (theStrChar +2) of TheString)="d" thenif (char (theStrChar +3) of TheString)="6" then return "√∑"if (char (theStrChar +3) of TheString)="7" then return "‚óä"if (char (theStrChar +3) of TheString)="8" then return "√ø"if (char (theStrChar +3) of TheString)="9" then return "≈∏"if (char (theStrChar +3) of TheString)="a" then return "/"if (char (theStrChar +3) of TheString)="b" then return "‚Ǩ"if (char (theStrChar +3) of TheString)="c" then return "‚Äπ"if (char (theStrChar +3) of TheString)="d" then return "‚Ä∫"if (char (theStrChar +3) of TheString)="f" then return "Ô¨Ç"end ifif (char (theStrChar +2) of TheString)="e" thenif (char (theStrChar +3) of TheString)="0" then return "‚Ä°"if (char (theStrChar +3) of TheString)="1" then return "¬∑"if (char (theStrChar +3) of TheString)="3" then return "‚Äû"if (char (theStrChar +3) of TheString)="4" then return "‚Ä∞"if (char (theStrChar +3) of TheString)="5" then return "√Ç"if (char (theStrChar +3) of TheString)="6" then return "√ä"if (char (theStrChar +3) of TheString)="7" then return "√Å"if (char (theStrChar +3) of TheString)="8" then return "√ã"if (char (theStrChar +3) of TheString)="9" then return "√à"if (char (theStrChar +3) of TheString)="a" then return "√ç"if (char (theStrChar +3) of TheString)="b" then return "√é"if (char (theStrChar +3) of TheString)="c" then return "√è"if (char (theStrChar +3) of TheString)="d" then return "√å"if (char (theStrChar +3) of TheString)="e" then return "√ì"if (char (theStrChar +3) of TheString)="f" then return "√î"end ifif (char (theStrChar +2) of TheString)="f" thenif (char (theStrChar +3) of TheString)="0" then return "Ô£ø"if (char (theStrChar +3) of TheString)="1" then return "√í"if (char (theStrChar +3) of TheString)="2" then return "√ö"if (char (theStrChar +3) of TheString)="3" then return "√õ"if (char (theStrChar +3) of TheString)="4" then return "√ô"if (char (theStrChar +3) of TheString)="5" then return "ƒ±"if (char (theStrChar +3) of TheString)="a" then return "Àô"if (char (theStrChar +3) of TheString)="b" then return "Àö"end ifend HandleCharactersfunction HandleStyles Stringset cursor to busyput offset("\b",String) into BoldLocput offset("\i",String) into ItalicLocput offset("\ul",String) into ULineLocput offset("\outl",String) into OutLineLocput offset("\shad",String) into ShadowLocput offset("\plain",String) into PlainLocput empty into TheStyleif PlainLoc ‚↠0 thenreturn "plain"end ifif (BoldLoc = 0) and (ItalicLoc = 0) and (ULineLoc = 0) and¬¨(OutLineLoc = 0) and (ShadowLoc = 0) thenreturn "plain"elserepeat with PresentChar = 1 to (length(String))if char PresentChar of String = " " thenexit repeatelseput char PresentChar of String after TheStyleend ifend repeatdelete char 1 of TheStyleput offset("\b",TheStyle) into BoldLocif BoldLoc ‚↠0 thenif char (BoldLoc + 2) of TheStyle = " "thendelete char BoldLoc to (BoldLoc + 2) of TheStyleelsedelete char BoldLoc to (BoldLoc + 1) of TheStyleend ifput "bold," before char BoldLoc of TheStyleend ifput offset("\i",TheStyle) into ItalicLocif ItalicLoc ‚↠0 thenif char (ItalicLoc + 2) of TheStyle = " "thendelete char ItalicLoc to (ItalicLoc + 2) of TheStyleelsedelete char ItalicLoc to (ItalicLoc + 1) of TheStyleend ifput "italic," before char ItalicLoc of TheStyleend ifput offset("\ul",TheStyle) into ULineLocif ULineLoc ‚↠0 thenif char (ULineLoc + 3) of TheStyle = " "thendelete char ULineLoc to (ULineLoc + 3) of TheStyleelsedelete char ULineLoc to (ULineLoc + 2) of TheStyleend ifput "underline," before char ULineLoc of TheStyleend ifput offset("\outl",TheStyle) into OutLineLocif OutLineLoc ‚↠0 thenif char (OutLineLoc + 5) of TheStyle = " "thendelete char OutLineLoc to (OutLineLoc + 5) of TheStyleelsedelete char OutLineLoc to (OutLineLoc + 4) of TheStyleend ifput "outline," before char OutLineLoc of TheStyleend ifput offset("\shad",TheStyle) into ShadowLocif ShadowLoc ‚↠0 thenif char (ShadowLoc + 5) of TheStyle = " "thendelete char ShadowLoc to (ShadowLoc + 5) of TheStyleelsedelete char ShadowLoc to (ShadowLoc + 4) of TheStyleend ifput "shadow," before char ShadowLoc of TheStyleend ifdelete last char of TheStylerepeat with ThisItem = 1 to the number of items of TheStyleif char 1 of item ThisItem of TheStyle = "\" thendelete item ThisItem of TheStyleend ifend repeatend ifreturn TheStyleend HandleStylesfunction HandleChars container--interpreting special charactersrepeat (the length of container div 2) --The maximum encoded sizeset cursor to busyput offset("\'",container) into MetaCharLocif MetaCharLoc ‚↠0 thenput HandleCharacters(char MetaCharLoc to (MetaCharLoc + 3) of container)¬¨into tempAltChardelete char MetaCharLoc to (MetaCharLoc + 3) of containerput tempAltChar before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting carriage returns and page changerepeat (the length of container div 2)set cursor to busyput offset("\par",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 4) of containerput RETURN before char MetaCharLoc of containerelseexit repeatend ifend repeatrepeat (the length of container div 2)set cursor to busyput offset("\page",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 5) of containerelseexit repeatend ifend repeat--interpreting tabulations--Note: tabulations move the cursor from field to field, it is--not possible to enter a real tab in a field. To fix this,--we enter four spaces to simulate a tab character.repeat (the length of container div 2)set cursor to busyput offset("\tab",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 3) of containerput "    " before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting bulletsrepeat (the length of container)set cursor to busyput offset("\bullet",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 7) of containerput "‚Ä¢" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting emdashrepeat (the length of container div 2)set cursor to busyput offset("\emdash",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 7) of containerput "‚Äì" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting endashrepeat (the length of container div 2)set cursor to busyput offset("\endash",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 7) of cd fld Destput "‚Äî" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting left simple quotesrepeat (the length of container div 2)set cursor to busyput offset("\lquote",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 7) of containerput "‚Äò" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting left double quotesrepeat (the length of container div 2)set cursor to busyput offset("\ldblquote",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 10) of containerput "‚Äú" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting right simple quotesrepeat (the length of container div 2)set cursor to busyput offset("\rquote",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 7) of containerput "‚Äô" before char MetaCharLoc of containerelseexit repeatend ifend repeat--interpreting right double quotesrepeat (the length of container div 2)set cursor to busyput offset("\rdblquote",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 10) of containerput "‚Äù" before char MetaCharLoc of containerelseexit repeatend ifend repeat--We substitute the left accolade to avoid confusionrepeat (the length of container div 2)set cursor to busyput offset("\{",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char (MetaCharLoc + 1) of containerput "lacc" after char MetaCharLoc of containerelseexit repeatend ifend repeat--we substitute the right accolade to avoid confusionrepeat (the length of container div 2)set cursor to busyput offset("\}",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char (MetaCharLoc + 1) of containerput "racc" after char MetaCharLoc of containerelseexit repeatend ifend repeat--We substitute the backslash to avoid confusionrepeat (the length of container div 2)set cursor to busyput offset("\\",container) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char (MetaCharLoc + 1) of containerput "bslash" after char MetaCharLoc of containerelseexit repeatend ifend repeatreturn containerend HandleCharson HandleCharsLeftglobal Destrepeat (the length of cd fld Dest div 2)set cursor to busyput offset("\qj",cd fld Dest) into MetaCharLocif MetaCharLoc ‚↠0 thendelete char MetaCharLoc to (MetaCharLoc + 2) of cd fld Destelseexit repeatend ifend repeatend HandleCharsLeftfunction HandleFont FontIDglobal HeadTblrepeat with LineNo = 1 to ((the number of lines of HeadTbl) div 2)set cursor to busyif line ((LineNo * 2) - 1) of HeadTbl = FontID thenput line (LineNo * 2) of HeadTbl into MyFontreturn MyFontend ifend repeat-- Note : if the Font is not available on the foreign system,-- HyperCard defaults to Geneva.end HandleFont</script>
  43.     </part>
  44.     <part>
  45.         <id>3</id>
  46.         <type>field</type>
  47.         <visible> <true /> </visible>
  48.         <dontWrap> <false /> </dontWrap>
  49.         <dontSearch> <false /> </dontSearch>
  50.         <sharedText> <false /> </sharedText>
  51.         <fixedLineHeight> <false /> </fixedLineHeight>
  52.         <autoTab> <false /> </autoTab>
  53.         <lockText> <false /> </lockText>
  54.         <rect>
  55.             <left>13</left>
  56.             <top>72</top>
  57.             <right>466</right>
  58.             <bottom>265</bottom>
  59.         </rect>
  60.         <style>scrolling</style>
  61.         <autoSelect> <false /> </autoSelect>
  62.         <showLines> <false /> </showLines>
  63.         <wideMargins> <false /> </wideMargins>
  64.         <multipleLines> <false /> </multipleLines>
  65.         <reservedFamily> 0 </reservedFamily>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>0</icon>
  68.         <textAlign>left</textAlign>
  69.         <font>Times</font>
  70.         <textSize>12</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <textHeight>16</textHeight>
  73.         <name>Import</name>
  74.         <script></script>
  75.     </part>
  76.     <part>
  77.         <id>5</id>
  78.         <type>button</type>
  79.         <visible> <true /> </visible>
  80.         <reserved5> 0 </reserved5>
  81.         <reserved4> 0 </reserved4>
  82.         <reserved3> 0 </reserved3>
  83.         <reserved2> 0 </reserved2>
  84.         <reserved1> 0 </reserved1>
  85.         <enabled> <true /> </enabled>
  86.         <rect>
  87.             <left>405</left>
  88.             <top>9</top>
  89.             <right>436</right>
  90.             <bottom>66</bottom>
  91.         </rect>
  92.         <style>transparent</style>
  93.         <showName> <false /> </showName>
  94.         <highlight> <false /> </highlight>
  95.         <autoHighlight> <true /> </autoHighlight>
  96.         <sharedHighlight> <true /> </sharedHighlight>
  97.         <family>0</family>
  98.         <titleWidth>0</titleWidth>
  99.         <icon>902</icon>
  100.         <textAlign>center</textAlign>
  101.         <font>Chicago</font>
  102.         <textSize>12</textSize>
  103.         <textStyle>plain</textStyle>
  104.         <name>Go</name>
  105.         <script>on mouseUpgo prev cardend mouseUp</script>
  106.     </part>
  107.     <part>
  108.         <id>6</id>
  109.         <type>button</type>
  110.         <visible> <true /> </visible>
  111.         <reserved5> 0 </reserved5>
  112.         <reserved4> 0 </reserved4>
  113.         <reserved3> 0 </reserved3>
  114.         <reserved2> 0 </reserved2>
  115.         <reserved1> 0 </reserved1>
  116.         <enabled> <true /> </enabled>
  117.         <rect>
  118.             <left>435</left>
  119.             <top>9</top>
  120.             <right>466</right>
  121.             <bottom>66</bottom>
  122.         </rect>
  123.         <style>transparent</style>
  124.         <showName> <false /> </showName>
  125.         <highlight> <false /> </highlight>
  126.         <autoHighlight> <true /> </autoHighlight>
  127.         <sharedHighlight> <true /> </sharedHighlight>
  128.         <family>0</family>
  129.         <titleWidth>0</titleWidth>
  130.         <icon>20098</icon>
  131.         <textAlign>center</textAlign>
  132.         <font>Chicago</font>
  133.         <textSize>12</textSize>
  134.         <textStyle>plain</textStyle>
  135.         <name>Go</name>
  136.         <script>on mouseUpgo homeend mouseUp</script>
  137.     </part>
  138.     <part>
  139.         <id>8</id>
  140.         <type>button</type>
  141.         <visible> <true /> </visible>
  142.         <reserved5> 0 </reserved5>
  143.         <reserved4> 0 </reserved4>
  144.         <reserved3> 0 </reserved3>
  145.         <reserved2> 0 </reserved2>
  146.         <reserved1> 0 </reserved1>
  147.         <enabled> <true /> </enabled>
  148.         <rect>
  149.             <left>246</left>
  150.             <top>34</top>
  151.             <right>280</right>
  152.             <bottom>67</bottom>
  153.         </rect>
  154.         <style>transparent</style>
  155.         <showName> <false /> </showName>
  156.         <highlight> <false /> </highlight>
  157.         <autoHighlight> <true /> </autoHighlight>
  158.         <sharedHighlight> <true /> </sharedHighlight>
  159.         <family>0</family>
  160.         <titleWidth>0</titleWidth>
  161.         <icon>14767</icon>
  162.         <textAlign>center</textAlign>
  163.         <font>Chicago</font>
  164.         <textSize>12</textSize>
  165.         <textStyle>plain</textStyle>
  166.         <name>Go</name>
  167.         <script>on mouseUpshow card fld 2end mouseUp</script>
  168.     </part>
  169.     <part>
  170.         <id>9</id>
  171.         <type>field</type>
  172.         <visible> <false /> </visible>
  173.         <dontWrap> <false /> </dontWrap>
  174.         <dontSearch> <false /> </dontSearch>
  175.         <sharedText> <false /> </sharedText>
  176.         <fixedLineHeight> <false /> </fixedLineHeight>
  177.         <autoTab> <false /> </autoTab>
  178.         <lockText> <true /> </lockText>
  179.         <rect>
  180.             <left>13</left>
  181.             <top>7</top>
  182.             <right>466</right>
  183.             <bottom>68</bottom>
  184.         </rect>
  185.         <style>shadow</style>
  186.         <autoSelect> <false /> </autoSelect>
  187.         <showLines> <false /> </showLines>
  188.         <wideMargins> <true /> </wideMargins>
  189.         <multipleLines> <false /> </multipleLines>
  190.         <reservedFamily> 0 </reservedFamily>
  191.         <titleWidth>0</titleWidth>
  192.         <icon>0</icon>
  193.         <textAlign>center</textAlign>
  194.         <font>Geneva</font>
  195.         <textSize>12</textSize>
  196.         <textStyle>plain</textStyle>
  197.         <textHeight>16</textHeight>
  198.         <name></name>
  199.         <script>on mouseUphide meend mouseUp</script>
  200.     </part>
  201.     <content>
  202.         <layer>card</layer>
  203.         <id>4</id>
  204.         <text>Yet to check:-styles</text>
  205.     </content>
  206.     <content>
  207.         <layer>card</layer>
  208.         <id>9</id>
  209.         <text><span class="style40">o learn more on the process of importing Rich Text File into HyperCard 2.0, read the script of the button "RTF Import".</span><span class="style1"></span><span class="style32">-click me to remove message-</span></text>
  210.     </content>
  211.     <name></name>
  212.     <script></script>
  213. </card>
  214.  
  215.  
  216. card_4255.xml
  217. <?xml version="1.0" encoding="utf-8" ?>
  218. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  219. <card>
  220.     <id>4255</id>
  221.     <filler1>0</filler1>
  222.     <bitmap>BMAP_4699.pbm</bitmap>
  223.     <cantDelete> <false /> </cantDelete>
  224.     <showPict> <true /> </showPict>
  225.     <dontSearch> <false /> </dontSearch>
  226.     <owner>2719</owner>
  227.     <link rel="stylesheet" type="text/css" href="stylesheet_3212.css" />
  228.     <part>
  229.         <id>1</id>
  230.         <type>field</type>
  231.         <visible> <true /> </visible>
  232.         <dontWrap> <false /> </dontWrap>
  233.         <dontSearch> <false /> </dontSearch>
  234.         <sharedText> <false /> </sharedText>
  235.         <fixedLineHeight> <false /> </fixedLineHeight>
  236.         <autoTab> <false /> </autoTab>
  237.         <lockText> <true /> </lockText>
  238.         <rect>
  239.             <left>28</left>
  240.             <top>13</top>
  241.             <right>336</right>
  242.             <bottom>260</bottom>
  243.         </rect>
  244.         <style>shadow</style>
  245.         <autoSelect> <false /> </autoSelect>
  246.         <showLines> <false /> </showLines>
  247.         <wideMargins> <true /> </wideMargins>
  248.         <multipleLines> <false /> </multipleLines>
  249.         <reservedFamily> 0 </reservedFamily>
  250.         <titleWidth>0</titleWidth>
  251.         <icon>0</icon>
  252.         <textAlign>center</textAlign>
  253.         <font>Geneva</font>
  254.         <textSize>12</textSize>
  255.         <textStyle>plain</textStyle>
  256.         <textHeight>16</textHeight>
  257.         <name></name>
  258.         <script></script>
  259.     </part>
  260.     <part>
  261.         <id>2</id>
  262.         <type>button</type>
  263.         <visible> <true /> </visible>
  264.         <reserved5> 0 </reserved5>
  265.         <reserved4> 0 </reserved4>
  266.         <reserved3> 0 </reserved3>
  267.         <reserved2> 0 </reserved2>
  268.         <reserved1> 0 </reserved1>
  269.         <enabled> <true /> </enabled>
  270.         <rect>
  271.             <left>342</left>
  272.             <top>219</top>
  273.             <right>450</right>
  274.             <bottom>258</bottom>
  275.         </rect>
  276.         <style>transparent</style>
  277.         <showName> <false /> </showName>
  278.         <highlight> <false /> </highlight>
  279.         <autoHighlight> <true /> </autoHighlight>
  280.         <sharedHighlight> <true /> </sharedHighlight>
  281.         <family>0</family>
  282.         <titleWidth>0</titleWidth>
  283.         <icon>26425</icon>
  284.         <textAlign>center</textAlign>
  285.         <font>Chicago</font>
  286.         <textSize>12</textSize>
  287.         <textStyle>plain</textStyle>
  288.         <name>Go</name>
  289.         <script>on mouseUpgo next cardend mouseUp</script>
  290.     </part>
  291.     <content>
  292.         <layer>card</layer>
  293.         <id>1</id>
  294.         <text><span class="style31">TF Import </span><span class="style1"></span><span class="style32">HyperTalk 2.0</span><span class="style33"> script for RTF importing brought to you by</span><span class="style1"></span><span class="style34">Francis Keith Bourgoin</span><span class="style1"></span><span class="style13">for the</span><span class="style1"></span><span class="style37">Club Macintosh de Qu√©bec (CMQ) </span><span class="style1"></span><span class="style38">the largest french Macintosh Clubin North America</span><span class="style1"></span><span class="style13">To contact</span><span class="style39">Keith Bourgoin</span><span class="style13">(AOL : FKBourgoin)(InterNet : KBourgoin@fse.ulaval.ca)</span><span class="style39">Club Macintosh de Qu√©bec</span><span class="style13">(418) 657-6916</span></text>
  295.     </content>
  296.     <name></name>
  297.     <script></script>
  298. </card>
  299.  
  300.  
  301.